package com.pks.datacenter.entity.api;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.pks.util.coder.database.DBField;
import com.pks.util.coder.database.DBQuery;
import com.pks.util.coder.database.DBTable;
import com.pks.web.mybatis.entity.BasicEntity;

@Data
@EqualsAndHashCode(callSuper = true)
@DBTable(tags = "数据源对外接口参数设置" , index_normal = {"apiId"} )
public class ApiParams extends BasicEntity{
	
	
	private static final long serialVersionUID = -5876842571440830142L;

	/**数值类型*/
	public static final int PARAMTYPE_NUMBER = 1;
	/**字符串*/
	public static final int PARAMTYPE_STRING = 2;
	/**日期*/
	public static final int PARAMTYPE_DATE = 3;
	
	/**相等*/
	public static final int COMPARETYPE_QEUALS = 1;
	/**小于*/
	public static final int COMPARETYPE_LESSTHAN = 2;
	/**大于*/
	public static final int COMPARETYPE_GREATERTHAN = 3;
	
	
	@DBField(comment = "接口ID" , nullable = false)
	@DBQuery
	private Long apiId;
	
	@DBQuery
	@DBField(comment = "数据源ID" , nullable = false)
	private Long dbId;
	
	@DBField(comment = "参数名" , nullable = false)
	@DBQuery( value = {"=" , "like"})
	private String paramName;
	
	@DBField(comment = "数据库字段ID" , nullable = false)
	@DBQuery
	private Long dbFieldId;
	
	@DBField(comment = "参数类型 1-数值  2-字符串 3-日期" , nullable = false)
	@DBQuery
	private Integer paramType;
	
	@DBField(comment = "比较类型  1-相等  2-小于  3-大于 " , defaultValue = "1" , nullable = false)
	private Integer compareType;
	
	@DBField(comment = "是否必传", nullable = false)
	@DBQuery
	private Integer requiredState;
	
	
	private String show_dbField_enName;
	
}
